Skip to content

Считалочка#7

Open
stuffacc wants to merge 4 commits intomasterfrom
loop_list
Open

Считалочка#7
stuffacc wants to merge 4 commits intomasterfrom
loop_list

Conversation

@stuffacc
Copy link
Owner

No description provided.

@stuffacc stuffacc requested a review from chernishev November 16, 2025 13:24
Copy link

@p-senichenkov p-senichenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Небольшие замечания по стилю.
Из критичного:

  • оператор -> -- я уверен, что Вас этому учили на одном из первых занятий;
  • код из предыдущего задания.


Node* head = list.head;

while ((*head).next != NULL) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему Вы не пользуетесь оператором ->?

@@ -0,0 +1,65 @@
#include "sorted_list.h"

void main() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В стайлгайде сказано, что в определениях функций открывающая фигурная скобка должна быть на новой строке.


Node* head = list.head;

while ((*head).next != NULL) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

На NULL принято проверять так: while (head->next). И стайлгайд тоже так требует.

for (int i = 1; i <= n; i++) {
addValue(&list, i);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отступов больше чем в одну строку внутри функции не должно быть.

while (list.size > 1) {
if (num == m) {
(*prev).next = (*head).next;
//free(head);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не надо оставлять закомментриванный код.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для этой задачи сортированный список не нужен -- достаточно обычного. И в задании не сказано использовать код из предыдущей задачи. Так что проще было бы реализовать связный список заново.

А если хотите переиспользовать предыдущее решение, то нужно растить одну ветку от другой, а не копировать код.

Copy link

@p-senichenkov p-senichenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Всё ещё нужно исправить замечания

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants